package com.ihighest.app.infox.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;

import com.ihighest.app.infox.R;

/**
 * TODO (类名称)
 * StoreListViewAdapter
 * <pre>
 * Description: TODO (描述类的主要功能)
 * 附近农资商店list列表的适配器
 * </pre>
 * 
 * <pre>
 * Example: TODO (描述类的的主要用法) (可选)
 * </pre>
 *
 * @author yyh Created at 2015-10-13 下午1:13:46
 * @version 1.0
 */
public class StoreListViewAdapter extends BaseAdapter {
	private LayoutInflater inflater;
	Context context;
	

	public StoreListViewAdapter(Context context) {
		super();
		this.context = context;
		inflater=LayoutInflater.from(context);
		
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 5;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int posion, View convertView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		
		
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.infox_near_the_agricultural_stores_itemlayout, null);
			holder.stores_item_icon=(ImageView) convertView.findViewById(R.id.id_stores_imageview);
			holder.stores_item_name=(TextView) convertView.findViewById(R.id.id_new_item_name);
			holder.stores_item_ratingbar= (RatingBar) convertView.findViewById(R.id.id_stores_ratingbar);
			holder.stores_item_distance=(TextView) convertView.findViewById(R.id.id_stores_distance);
	
			holder.stores_item_in=(TextView) convertView.findViewById(R.id.id_stores_in);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		return  convertView;
	}
	
	
	class ViewHolder {
		
		
		ImageView   stores_item_icon;
		TextView      stores_item_name;
		RatingBar  stores_item_ratingbar;
		TextView   stores_item_distance;//juli
		TextView   stores_item_in;
		
		
		
	}
}


